package com.ruoyi.web.controller.app;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.system.domain.FyProjectPlan;
import com.ruoyi.system.domain.vo.business.FyProjectApplySelectListVO;
import com.ruoyi.system.domain.vo.business.FyProjectPlanSaveVO;
import com.ruoyi.system.domain.vo.business.FyProjectPlanSelectListVO;
import com.ruoyi.system.service.IFyProjectPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 扶垚项目进度上报Controller
 */
@Controller
@Api(tags = {"(app)扶垚项目进度上报"})
@RequestMapping("/app/system/fyProjectPlan")
public class AppFyProjectPlanController extends BaseController {

    @Autowired
    private IFyProjectPlanService fyProjectPlanService;

    /**
     * (app)新增扶垚项目进度上报
     */
    @ApiOperation("(app)新增扶垚项目进度上报")
    //@RequiresPermissions("system:application:add")
    @Log(title = "(app)扶垚项目进度上报", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave( @RequestBody FyProjectPlanSaveVO saveVO) {
        try {
            FyProjectPlan entity = new FyProjectPlan();
            BeanUtils.copyBeanProp(entity, saveVO);
            entity.setCreateUserName(getUsername());
            fyProjectPlanService.save(entity);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return success();
    }

}
